# $< stand for the first file of prerequirefiles
# $@ stand for the target files
# #^ stand for all of the prerequirefiles
# %.o:%.cpp stand for the files which replace the %.o's suffix with .cpp
CC := g++
CPPFLAGS := -Wall -O2 -fPIC
LDFLAGS := -lpthread
TARGET := libthreadpool.a
OBJS:=pool.o

#$(TARGET):$(OBJS)
#	$(CC) -shared $^ -o $@ 
$(TARGET):$(OBJS)
	$(AR) r $@ $^

$(OBJS) : %.o:%.cpp pool.h lock.hpp condition.hpp multitimer.hpp scope_guard.hpp threadpoolimp.hpp worker_thread.hpp timer_thread.hpp
	$(CC) -c -g $(CPPFLAGS) $< -o $@

clean:
	-rm $(TARGET) $(OBJS)
